package tech.edwardvan.cloudapib.client;


import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import tech.edwardvan.cloudapib.entity.Message;
import tech.edwardvan.cloudapib.factory.CloudBClientFallbackFactory;
import tech.edwardvan.cloudcommon.entity.ServerResponse;

/**
 * 业务B 客户端
 *
 * @author EdwardVan
 */
@FeignClient(name = "cloud-b", fallbackFactory = CloudBClientFallbackFactory.class)
public interface CloudBClient {
    /**
     * 接收消息
     *
     * @param message 消息
     * @return 消息回执
     */
    @PostMapping("/b/receive")
    ServerResponse<Message> receive(@RequestBody Message message);
}
